package org.zfm.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfigurer implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 添加拦截器
        registry.addInterceptor(loginInterceptor)
                // 添加拦截路径
                .addPathPatterns("/**")
                // 添加放行路径 放行 登录 用户注册 店铺入驻
                .excludePathPatterns("/logininfo/login","/verify/imageCode/*",
                        "/verify/toBind/smsCode","/verify/smsLoginCode/*","/verify/getPasswordSmsCode/*",
                        "/user/smsCodeLogin","/user/reSetPassword","/verify/smsCode","/user/register",
                        "/user/login","/user/bind","/shop/settlement");
    }


}
